package com.utils.failureanalysis.data.dao;

import com.utils.failureanalysis.data.model.singleRecorder.AnalysisData;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface AnalysisDataRepository extends JpaRepository<AnalysisData, String> {
    //通过taskId相等查询
    AnalysisData findById(Long taskId);
    List<AnalysisData> findByTaskId(String taskId);
    List<AnalysisData> findByTaskIdLike(@Param("taskId") String taskId);

    //通过taskId Like查询，参数为name
//    List<AnalysisData> findByNameLike(String taskId);
    //通过名字和地址查询,参数为taskId和moduleName
    List<AnalysisData> findByTaskIdAndModuleName(String taskId, String moduleName);
    List<AnalysisData> findByTaskIdLikeAndModuleName(String taskId, String moduleName);
//通过taskId查询是否存在
    boolean existsByTaskId(String taskId);
    boolean existsByTaskIdLike(String taskId);
}
